"""
rail.py --                                                                                            
                                                                                                                                                                                                        
It sets a rail's geometric properties.                                              
                                                                                                                                                                                                            
Date of creation: 2007-03-17                                                                        
                                                                                                                                                                                                
Copyright  Robotics and Automation Group, Pontificia Universidad Javeriana - Cali.                  
    Freddy Naranjo Perez, fnaranjo@puj.edu.co                                                                   
    Antonio Alejandro Matta Gomez amatta@puj.edu.co                                      
    Julian David Colorado, jdcolorado@puj.edu.co                           
    Juan Camilo Acosta Mejia, jcacosta@puj.edu.co                                    
                                                                                                                                                                                                        
See the file "license.terms" for information on usage and redistribution of this file, and for a    
DISCLAIMER OF ALL WARRANTIES.
"""

import vtk

class Rail:
  def __init__( self, ren, raildim ):
        """ Inits a rail's figure and its associated texture"""
        
        #rail sides
        RailsideX=0.005
        RailsideY=0.002
        RailsideZ=2.0
        #rail top
        RailtopX=0.02
        RailtopY=0.002
        RailtopZ=2.0
        
        #setting the rail geometric parameters
        self.rail = vtk.vtkCubeSource()
        self.rail.SetXLength( raildim[0] )
        self.rail.SetYLength( raildim[1] )
        self.rail.SetZLength( raildim[2] ) 
        self.railMapper = vtk.vtkPolyDataMapper()
        self.railMapper.SetInputConnection(self.rail.GetOutputPort())
        self.railActor = vtk.vtkActor()
        self.railActor.SetMapper(self.railMapper)
        self.railActor.AddPosition( 0, 0.35, -0.0125 )
        self.railActor.GetProperty().SetColor(0.721568, 0.721568, 0.721568)
        
        #encapsulate everything into an assembly
        self.railassembly = vtk.vtkAssembly()
        self.railassembly.AddPart(self.railActor)
        
        
    
        
    
    

        
        
            
        
    

    
  
  